import qs from "qs";
import { request } from "./request.js";

// 获取
export function getProductList(obj) {
  return request({
    url: "product/listProduct",
    method: "post",
    data: qs.stringify(obj),
  });
}
// 更新上下架状态
export function updateBanner(obj) {
  return request({
    url: "product/updateProStatus",
    method: "post",
    data: qs.stringify(obj),
  });
}
/// 获取商品详情
export function listProductDetail(obj) {
    return request({
      url: "product/listProductDetail",
      method: "post",
      data: qs.stringify(obj),
    });
  }

//更新商品详情
export function updatepro(obj) {
  return request({
    url: "product/updatepro",
    method: "post",
    data: obj,
    headers: {
      "Content-Type": "multipart/form-data",
    },
  });
}
// 添加，更新商品规格（切换2）
export function addOrEditFormat(obj) {
  return request({
    url: "product/addOrEditFormat",
    method: "post",
    data: obj,
    headers: {
      "Content-Type": "multipart/form-data",
    },
  });
}

// 删除/启用/禁用商品轮播图/详情图
export function delOrUpdate(obj) {
  return request({
    url: "product/delOrUpdate",
    method: "post",
    data: qs.stringify(obj),
  });
}

// 添加详情图（切换4）
export function addDeailPic(obj) {
  return request({
    url: "product/addDeailPic",
    method: "post",
    data: obj,
    headers: {
      "Content-Type": "multipart/form-data",
    },
  });
}

// 添加轮播图（切换3）
export function addLoop(obj) {
  return request({
    url: "product/addBannerPic",
    method: "post",
    data: obj,
    headers: {
      "Content-Type": "multipart/form-data",
    },
  });
}

//
